package com.yanqu.road.entity.activity.suitang.data;

import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.DataStatus;
import com.yanqu.road.entity.FieldTypeAnnotation;
import com.yanqu.road.entity.activity.suitang.entity.city.CrossSuiTangCollect;
import com.yanqu.road.entity.activity.suitang.entity.union.CrossSuiTangCommanderData;
import com.yanqu.road.entity.activity.suitang.entity.union.CrossSuiTangUnionBuff;
import com.yanqu.road.entity.activity.suitang.entity.union.CrossSuiTangUnionRound;

import java.sql.Types;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArrayList;

@FieldTypeAnnotation(tableName = "t_c_suitang_union_data")
public class CrossSuiTangUnionData extends DataObject {

    @FieldTypeAnnotation(desc = "活动ID", select = true, update = true)
    private int activityId;

    @FieldTypeAnnotation(desc = "商会分组ID", select = true, update = true)
    private int groupId;

    @FieldTypeAnnotation(desc = "商会ID", update = true)
    private String unionUid = "";

    @FieldTypeAnnotation(desc = "最终的排名积分")
    private int totalScore;

    @FieldTypeAnnotation(desc = "阵营红包值")
    private long redPacketValue = 0L;

    @FieldTypeAnnotation(desc = "指挥官", sqlType = Types.LONGVARCHAR)
    private CrossSuiTangCommanderData commanders = new CrossSuiTangCommanderData(); //指挥官 目前最多2个

    @FieldTypeAnnotation(desc = "商会轮次信息", sqlType = Types.LONGVARCHAR)
    private Map<Integer, CrossSuiTangUnionRound> unionRoundMap = new ConcurrentHashMap<>();

    @FieldTypeAnnotation(desc = "商会buff信息", sqlType = Types.LONGVARCHAR)
    private List<CrossSuiTangUnionBuff> unionBuffMap = new ArrayList<>();

    @FieldTypeAnnotation(desc = "城池采集收益（玩家ID，城池ID，数量）", sqlType = Types.LONGVARCHAR)
    private Map<Long, Map<Integer, CrossSuiTangCollect>> collectionMap = new ConcurrentHashMap<>();

    // ========================================================================
    public int getActivityId() {
        return activityId;
    }
    public void setActivityId(int activityId) {
        if (this.activityId != activityId) {
            this.activityId = activityId;
            setOp(DataStatus.Update);
        }
    }

    public int getGroupId() {
        return groupId;
    }
    public void setGroupId(int groupId) {
        if (this.groupId != groupId) {
            this.groupId = groupId;
            setOp(DataStatus.Update);
        }
    }

    public String getUnionUid() {
        return unionUid;
    }
    public void setUnionUid(String unionUid) {
        if (unionUid == null){
            return;
        }
        if (this.unionUid == null || !this.unionUid.equals(unionUid)) {
            this.unionUid = unionUid;
            setOp(DataStatus.Update);
        }
    }

    public int getTotalScore() {
        return totalScore;
    }
    public void setTotalScore(int totalScore) {
        if (this.totalScore != totalScore) {
            this.totalScore = totalScore;
            setOp(DataStatus.Update);
        }
    }

    public long getRedPacketValue() {
        return redPacketValue;
    }
    public void setRedPacketValue(long redPacketValue) {
        if (this.redPacketValue != redPacketValue) {
            this.redPacketValue = redPacketValue;
            setOp(DataStatus.Update);
        }
    }

    public CrossSuiTangCommanderData getCommanders() {
        return commanders;
    }
    public void setCommanders(CrossSuiTangCommanderData commanders) {
        if (null == commanders){
            return;
        }
        if (this.commanders == null || !this.commanders.equals(commanders)) {
            this.commanders = commanders;
            setOp(DataStatus.Update);
        }
    }

    public java.util.Map<java.lang.Integer, com.yanqu.road.entity.activity.suitang.entity.union.CrossSuiTangUnionRound> getUnionRoundMap() {
        return unionRoundMap;
    }
    public void setUnionRoundMap(java.util.Map<java.lang.Integer, com.yanqu.road.entity.activity.suitang.entity.union.CrossSuiTangUnionRound> unionRoundMap) {
        if (null == unionRoundMap){
            return;
        }
        if (this.unionRoundMap == null || !this.unionRoundMap.equals(unionRoundMap)) {
            this.unionRoundMap = unionRoundMap;
            setOp(DataStatus.Update);
        }
    }

    public java.util.Map<java.lang.Long, java.util.Map<java.lang.Integer, CrossSuiTangCollect>> getCollectionMap() {
        return collectionMap;
    }
    public void setCollectionMap(java.util.Map<java.lang.Long, java.util.Map<java.lang.Integer, CrossSuiTangCollect>> collectionMap) {
        if (null == collectionMap){
            return;
        }
        if (this.collectionMap == null || !this.collectionMap.equals(collectionMap)) {
            this.collectionMap = collectionMap;
            setOp(DataStatus.Update);
        }
    }

    public java.util.List<com.yanqu.road.entity.activity.suitang.entity.union.CrossSuiTangUnionBuff> getUnionBuffMap() {
        return unionBuffMap;
    }
    public void setUnionBuffMap(java.util.List<com.yanqu.road.entity.activity.suitang.entity.union.CrossSuiTangUnionBuff> unionBuffMap) {
        if (null == unionBuffMap){
            return;
        }
        if (this.unionBuffMap == null || !this.unionBuffMap.equals(unionBuffMap)) {
            this.unionBuffMap = unionBuffMap;
            setOp(DataStatus.Update);
        }
    }
}
